package com.sky.controller.admin;

import com.sky.constant.JwtClaimsConstant;
import com.sky.dto.EmployeeDTO;
import com.sky.dto.EmployeeLoginDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.sky.properties.JwtProperties;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.EmployeeService;
import com.sky.service.ReportService;
import com.sky.service.WorkSpaceService;
import com.sky.utils.JwtUtil;
import com.sky.utils.TimeForDataUtil;
import com.sky.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.Min;
import java.io.IOException;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;

/**
 * 员工管理
 */
@RestController
@RequestMapping("/admin/workspace")
@Slf4j
@Api(tags="员工相关接口")
public class WorkSpaceController {

    @Autowired
    private WorkSpaceService workSpaceService;
    @Autowired
    private ReportService reportService;

    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> overviewDishes() {
         log.info("查询菜品情况");
        return Result.success(workSpaceService.getDisheStatus());
    }

    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> overviewOrders() {
        log.info("查询订单情况");
        return Result.success(workSpaceService.getOrderStatus());
    }

    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> overviewSetmeals() {
        log.info("查询套餐情况");
        return Result.success(workSpaceService.getSetmealStatus());
    }

    @GetMapping("/businessData")
    public Result<BusinessDataVO> businessData() throws IOException {
        log.info("导出表格数据");
        LocalDate date = LocalDate.now();
        return Result.success(workSpaceService.getBusinessData(date,date)) ;
    }
}
